﻿<navigation:Page x:Class="AppLab.Views.Review" 
           xmlns:local="clr-namespace:AppLab"
           xmlns:control="clr-namespace:AppLab.Controls"
           xmlns:web="clr-namespace:AppLab.Web"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="800" d:DesignHeight="800"
           d:DataContext="{d:DesignInstance Type=web:ReviewSubmitData}" 
           Style="{StaticResource PageStyle}" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit">

    <Grid x:Name="LayoutRoot">
        <Grid.Resources>
            <local:DateTimeConverter x:Key="DateConverter" />
            <local:BooleanToVisibilityConverter x:Key="VisibleConverter"/>
            <local:NullItemToEntity x:Key="NullItemToEntity"/>
        </Grid.Resources>

        <ScrollViewer x:Name="PageScrollViewer" Style="{StaticResource PageScrollViewerStyle}">
            <toolkit:BusyIndicator x:Name="busyIndicatorLoad" Grid.RowSpan="2" BusyContent="{Binding Path=ApplicationStrings.BusyIndicatorLoad, Source={StaticResource ResourceWrapper}}">
                <toolkit:BusyIndicator x:Name="busyIndicator" BusyContent="{Binding Path=ApplicationStrings.BusyIndicatorRegisteringUser, Source={StaticResource ResourceWrapper}}"
                             IsBusy="{Binding IsBusy}">
                    <StackPanel x:Name="ContentStackPanel" Style="{StaticResource ContentStackPanelStyle}">
                        <Grid Height="40">
                            <TextBlock Margin="20,0,0,0" Style="{StaticResource ContentTextStyle}"  VerticalAlignment="Center"  HorizontalAlignment="Left"
                           Text="请审核客户端软件包"/>
                        </Grid>
                        <sdk:DataGrid AutoGenerateColumns="false" Name="dataGrid1" Height="200"
                               IsReadOnly="True" GridLinesVisibility="Vertical"
                               SelectionChanged="dataGrid1_SelectionChanged"
                               HorizontalAlignment="Left" BorderThickness="2" BorderBrush="#FFCE6A6A"
                               ColumnWidth="80" Margin="20,0,0,0" VerticalAlignment="Top" SelectionMode="Single">
                            <sdk:DataGrid.Columns>
                                <sdk:DataGridTextColumn Header="品牌" Width="100" Binding="{Binding MobileBrand}" />
                                <sdk:DataGridTextColumn Header="型号" Width="100" Binding="{Binding MobileType}" />
                                <sdk:DataGridTextColumn Header="版本"  Width="100" Binding="{Binding MobileVersion}" />
                                <sdk:DataGridTextColumn Header="提交人" Width="120" Binding="{Binding SubmitBy}" />
                                <sdk:DataGridTextColumn Header="提交时间" Width="140" Binding="{Binding SubmitTime, StringFormat=yyyy-MM-dd HH:mm}" />
                                <sdk:DataGridTextColumn Header="提交类型" Width="140" Binding="{Binding SubmitType}" />
                            </sdk:DataGrid.Columns>
                        </sdk:DataGrid>
                        <Grid>
                            <sdk:DataPager Name="dpReviewInfo" VerticalAlignment="Top" IsTotalItemCountFixed="True" HorizontalAlignment="Left"  Source="{Binding ItemsSource, ElementName=dataGrid1}" Margin="20,0,0,0" Grid.Row="1">
                            </sdk:DataPager>
                        </Grid>

                        <TextBlock Name="TipsForAdaptation" Height="20" VerticalAlignment="Center" Margin="20,20,0,0" FontSize="14" Foreground="Blue"></TextBlock>

                        <Grid Name="detailInfo" Visibility="{Binding ElementName=detailInfo,Path=IsHitTestVisible,Converter={StaticResource VisibleConverter}}">
                            <!--<control:CustomDataForm x:Name="DataForm" 
                                                        AutoEdit="True" CommandButtonsVisibility="None" 
                                                        Style="{StaticResource DataFormStyle}" HorizontalAlignment="Left" 
                                                        Margin="0,10,0,0"/>-->
                            <control:ReviewCustomDataForm x:Name="dataForm" 
                                                        AutoEdit="True" CommandButtonsVisibility="None"
                                                        Style="{StaticResource DataFormStyle}" HorizontalAlignment="Left" 
                                                        Margin="0,10,0,0"/>
                            <!--CurrentItem="{Binding ElementName=dataGrid1, Path=SelectedItem, Converter={StaticResource NullItemToEntity}}"-->
                            <Grid Margin="390,10,0,0">
                                <TextBlock Name="TipsForWrongInfo" VerticalAlignment="Top" Margin="0,0,0,0" FontSize="14" Foreground="Red"></TextBlock>

                                <RadioButton Content="接受" Height="16" HorizontalAlignment="Left" Margin="0,30,0,0" Name="rdoAccept" VerticalAlignment="Top" Checked="rdoAccept_Checked" />
                                <RadioButton Content="拒绝" Height="16" HorizontalAlignment="Left" Margin="100,30,0,0" Name="rdoReject" VerticalAlignment="Top" Checked="rdoReject_Checked" />

                                <TextBlock Height="22" HorizontalAlignment="Left" Margin="0,60,0,0" Name="textBlock1" Text="指定验收人：" VerticalAlignment="Top" Visibility="{Binding ElementName=rdoAccept, Path=IsChecked,Converter={StaticResource VisibleConverter}}"/>
                                <ComboBox Height="23" HorizontalAlignment="Left" Margin="80,60,0,0" Name="cmbTesters" VerticalAlignment="Top" Width="110" Visibility="{Binding ElementName=rdoAccept,Path=IsChecked,Converter={StaticResource VisibleConverter}}" />

                                <TextBlock Height="22" HorizontalAlignment="Left" Margin="0,100,0,0" Name="tbPriority" Text="任务优先级：" VerticalAlignment="Top" Visibility="{Binding ElementName=rdoAccept, Path=IsChecked,Converter={StaticResource VisibleConverter}}"/>
                                <ComboBox Height="23" HorizontalAlignment="Left" Margin="80,100,0,0" Name="cmbPriority" VerticalAlignment="Top" Width="40" Visibility="{Binding ElementName=rdoAccept,Path=IsChecked,Converter={StaticResource VisibleConverter}}" />

                                <TextBlock Height="22" HorizontalAlignment="Left" Margin="140,100,0,0" Name="tbComplTime" Text="期望验收完成时间：" VerticalAlignment="Top" Visibility="{Binding ElementName=rdoAccept, Path=IsChecked,Converter={StaticResource VisibleConverter}}"/>
                                <sdk:DatePicker Height="23" HorizontalAlignment="Left" Margin="260,100,0,0" Name="dtpComplTime" VerticalAlignment="Top" Width="120" Visibility="{Binding ElementName=rdoAccept,Path=IsChecked,Converter={StaticResource VisibleConverter}}" ></sdk:DatePicker>
                                <Button Name="buttonAccept" Content="提交" Width="60" Margin="0,140,0,0" Height="30" VerticalAlignment="Top" HorizontalAlignment="Left" Click="button1_Click" Visibility="{Binding ElementName=rdoAccept,Path=IsChecked,Converter={StaticResource VisibleConverter}}"/>

                                <TextBox Height="106" HorizontalAlignment="Left" Margin="0,50,0,0" Name="txtReviewComment" VerticalAlignment="Top" Width="325" Visibility="{Binding ElementName=rdoReject,Path=IsChecked,Converter={StaticResource VisibleConverter}}" TextWrapping="Wrap" AcceptsReturn="True" VerticalScrollBarVisibility="Visible" MaxLength="100" GotFocus="txtReviewComment_GotFocus" LostFocus="txtReviewComment_LostFocus" />
                                <Button Name="buttonReject" Content="提交" Width="60" Margin="0,160,0,0" Height="30" VerticalAlignment="Top" HorizontalAlignment="Left" Click="button1_Click" Visibility="{Binding ElementName=rdoReject,Path=IsChecked,Converter={StaticResource VisibleConverter}}"/>
                            </Grid>
                        </Grid>
                    </StackPanel>
                </toolkit:BusyIndicator>
            </toolkit:BusyIndicator>
        </ScrollViewer>
    </Grid>
</navigation:Page>
